package cn.edu.scau.cmi.lvmingyan.Comprehensive_Experiment;

import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.stage.Stage;

import cn.edu.scau.cmi.lvmingyan.singleton.InputWindow_singleton;
import cn.edu.scau.cmi.lvmingyan.abstractFactory.domain.InputWindow_af;
import cn.edu.scau.cmi.lvmingyan.adapter.InputWindow_Class;
import cn.edu.scau.cmi.lvmingyan.adapter.InputWindow_Object;
import cn.edu.scau.cmi.lvmingyan.client.AdapterOfClass;
import cn.edu.scau.cmi.lvmingyan.client.AdapterOfObject;
import cn.edu.scau.cmi.lvmingyan.client.CompositeSafety;
import cn.edu.scau.cmi.lvmingyan.client.CompositeSame;
import cn.edu.scau.cmi.lvmingyan.client.Factory;
import cn.edu.scau.cmi.lvmingyan.client.HibernateClient;
import cn.edu.scau.cmi.lvmingyan.client.InterProgrammingClient;
import cn.edu.scau.cmi.lvmingyan.client.SimpleFactory;
import cn.edu.scau.cmi.lvmingyan.client.SpringHibernateSessionClient;
import cn.edu.scau.cmi.lvmingyan.multition.InputWindow_multition;

public class Controller  implements Initializable{
	@FXML
	private Button b_singleton;
	@FXML
	private Button b_multition;
	@FXML
	private Button b_interface;
	@FXML
	private Button b_simpleFactory;
	@FXML
	private Button b_factory;
	@FXML
	private Button b_abstractFactory;
	@FXML
	private Button b_adapterObject;
	@FXML
	private Button b_adapterClass;
	@FXML
	private Button b_satefyComposite;
	@FXML
	private Button b_sameComposite;
	@FXML
	private Button b_hibernate;
	@FXML
	private Button b_spring;
	
	@Override
	public void initialize(URL location, ResourceBundle resources) {
	}
	
	public void Csingleton(ActionEvent event) throws Exception {
		System.out.println("单例模式");
		 InputWindow_singleton w=new  InputWindow_singleton();
		 w.start(new Stage());
		
	}
	
    public void Cmultition(ActionEvent event) throws Exception {
    	System.out.println("多例模式");
    	 InputWindow_multition w=new  InputWindow_multition();
		 w.start(new Stage());
	}
    
    public void Cinterface(ActionEvent event) {
    	System.out.println("接口模式");
    	InterProgrammingClient a=new InterProgrammingClient();
    	a.main(null);
	}
   
    public void CsimpleFactory(ActionEvent event) {
    	System.out.println("简单工厂模式");
    	SimpleFactory a=new SimpleFactory();
    	a.main(null);
	}
    
     public void Cfactory(ActionEvent event) {
    	 System.out.println("工厂模式");
    	 Factory a=new Factory();
    	 a.main(null);
	}
     
     public void CabstractFactory(ActionEvent event) throws Exception {
    	 System.out.println("抽象工厂模式");
    	 InputWindow_af w=new  InputWindow_af();
		 w.start(new Stage());
 	}
     
     public void CadapterObject(ActionEvent event) throws Exception {
    	 System.out.println("对象适配器模式");
    	 InputWindow_Object w=new  InputWindow_Object();
		 w.start(new Stage());
 	}
     
     public void CadapterClass(ActionEvent event) throws Exception {
    	 System.out.println("类适配器模式");
    	 InputWindow_Class w=new  InputWindow_Class();
		 w.start(new Stage());
  	}
     
     public void CsatefyComposite(ActionEvent event) {
    	 System.out.println("安全组合模式");
    	 CompositeSafety a=new CompositeSafety();
    	 a.main(null);
  	}
     
     public void CsameComposite(ActionEvent event) {
    	 System.out.println("一致组合模式");
    	 CompositeSame a=new CompositeSame();
    	 a.main(null);
   	}
     
     public void Chibernate(ActionEvent event) {
    	 System.out.println("hibernate模式");
    	 HibernateClient a=new HibernateClient();
    	 a.main(null);
   	}
      
      public void Cspring(ActionEvent event) {
    	  System.out.println("spring模式");
    	  SpringHibernateSessionClient a=new  SpringHibernateSessionClient();
    	  a.main(null);
    	}

}
